UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Pk3hyTasuiAbj2VD3OnVxU2l0eOO8MTFdmyJ20SrO20='
WHERE
key_id = 'e468b25dcf5b98d8b28473602a9cba869fcf2b4501b46bc77cb4789a1de1456b'
AND (
token = 'Pk3hyTasuiAbj2VD3OnVxU2l0eOO8MTFdmyJ20SrO20='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)