UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hPYC6zsE9F9mAEaAlfumNoCUYFG+nQzP3sklb/1XgaE='
WHERE
key_id = '44bfeef4e9ae18dd37a519d1dff45a298419c9391464a2bb4cc28818b488b7a6'
AND (
token = 'hPYC6zsE9F9mAEaAlfumNoCUYFG+nQzP3sklb/1XgaE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)