UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '11SfQkmpglS9ItUP/E//m9PgMjt0+TNfijO6sjf56+g='
WHERE
key_id = 'ecd248e679496eeb1dd3c5b444031d59b992fec313ea44397fe13d37c31b0736'
AND (
token = '11SfQkmpglS9ItUP/E//m9PgMjt0+TNfijO6sjf56+g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)