UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xScOD3/aQ2SOyyAUp895wZU+nOk/La+nFwvPqfSnLRc='
WHERE
key_id = '308a359ffedc55b43cd176e1133d44328a5b95cdad8c3c173ba9c47de529438f'
AND (
token = 'xScOD3/aQ2SOyyAUp895wZU+nOk/La+nFwvPqfSnLRc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)