UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6EKkw8FDMmKhESrnQQrZ0rBO/6whdx8zPoGcvmE1fmg='
WHERE
key_id = '77a08623a3477b045adead93f427adc2b9ae43451535301298fa93b0f02a77b2'
AND (
token = '6EKkw8FDMmKhESrnQQrZ0rBO/6whdx8zPoGcvmE1fmg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)