UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Uvr/GPzZc+++8NcIzjujfoViO719gur6/6op2VsbtZM='
WHERE
key_id = 'ce52b3c334bdacba0c275c6fd75f39127426ef43b62a5504e55316cb7485faca'
AND (
token = 'Uvr/GPzZc+++8NcIzjujfoViO719gur6/6op2VsbtZM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)