UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4Tcy8CXua6JZfFCFYcgIRpNMkvwO9pixTkXhLauI6v8='
WHERE
key_id = '1569adc11730f25f9bc659264f96edbf07ef0e9552e26bb63ef49a5a5e262ca5'
AND (
token = '4Tcy8CXua6JZfFCFYcgIRpNMkvwO9pixTkXhLauI6v8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)