UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'KlalGnvKqaYgBenj4a+gGAWiTk6HD8L12XhvFO/tJAI='
WHERE
key_id = '0a67510e8480342b1a057cc27b0f85fce33e3e76b92b8d491c7586ecb682f7a6'
AND (
token = 'KlalGnvKqaYgBenj4a+gGAWiTk6HD8L12XhvFO/tJAI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)