UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '785kc8r76N6kOnTHDaUz2PNZ66jz+6nWnQw7koeZbl8='
WHERE
key_id = 'fb69ded0f846c9c9140fc4cfc6787a3c1469d91a08b1a5994d127b4737be74a9'
AND (
token = '785kc8r76N6kOnTHDaUz2PNZ66jz+6nWnQw7koeZbl8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)