UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'p/AB6q3NN0Q6v/82P2ts4usMKleX7/qrj5zAyl/rgw4='
WHERE
key_id = 'cf25ef0fad25cba290381486df95c7e58eddde92ab1241a0a2392650cf7c9451'
AND (
token = 'p/AB6q3NN0Q6v/82P2ts4usMKleX7/qrj5zAyl/rgw4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)