UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UUG6BfRv9+xMon3MgVqeMXY3wT8ZxSb6iessDlkQ0xI='
WHERE
key_id = '6b0be3ad8f0218c6005e418a48108ea3dead0274421fca5dbe974cd3c5e108fc'
AND (
token = 'UUG6BfRv9+xMon3MgVqeMXY3wT8ZxSb6iessDlkQ0xI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)