UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'sXi8HEcUcvJp62pzJ2uU/ayumFXKzGDiHRpxzXF5Aw0='
WHERE
key_id = 'f0826ed3f423e680987369bf5f669b2c4faf7fd29625e0cf53644947e3c14644'
AND (
token = 'sXi8HEcUcvJp62pzJ2uU/ayumFXKzGDiHRpxzXF5Aw0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)