UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rcsIUcNsgkrlo6gohsIz96h2AkSCoAcsbnbIUmg2qN0='
WHERE
key_id = '286ed755bd821212039027e1a1257f9032b6477b665568f4ba231f13ae5e999f'
AND (
token = 'rcsIUcNsgkrlo6gohsIz96h2AkSCoAcsbnbIUmg2qN0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)