UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'k7HAI9RATgUxYIFJ3R9oUwEcV6X2b3HRJH7VxDtTF3E='
WHERE
key_id = '10c94530308d9d17b8dbb7bf2d49087d83374ea138d1dcc3654f5cf55bb141e8'
AND (
token = 'k7HAI9RATgUxYIFJ3R9oUwEcV6X2b3HRJH7VxDtTF3E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)