UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'OocHJSx4709pJVAMbZfTpv6b07r68+82qOGgI8C5dWc='
WHERE
key_id = 'e6b52b211b38a115f6bcf3beabe7a26e8bde3f999cdaa8fc3f0b04b41dd58add'
AND (
token = 'OocHJSx4709pJVAMbZfTpv6b07r68+82qOGgI8C5dWc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)