UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'EkiQB1tgJ1y50JCP3rqHUYL4m+g0TscVUunsX5yvnCg='
WHERE
key_id = '7796888789c236add6bf6f0e1cf30af7e74bfd1900645fb6f847fb2087b8c6b4'
AND (
token = 'EkiQB1tgJ1y50JCP3rqHUYL4m+g0TscVUunsX5yvnCg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)