UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'DhSJBm/p7gMQ7paWscqpkm4NeFARqGYVXrfr93+lJnw='
WHERE
key_id = '83843a5b4502a48e59a6ac0d3d590a2758130787b4e4b40029c879c24dbd7443'
AND (
token = 'DhSJBm/p7gMQ7paWscqpkm4NeFARqGYVXrfr93+lJnw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)