UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xn3bb43nUxJ1CjicwSfazW/Av3RWjU9sG0YkVSWyW40='
WHERE
key_id = '23d022f9386ffd74b6abede6b38e69c3bdf035f3a5084c2832a259670444f648'
AND (
token = 'xn3bb43nUxJ1CjicwSfazW/Av3RWjU9sG0YkVSWyW40='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)