UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'OzD6GXIVJ1d9idUEV3YIQasSa9fXZbO5O4rsHInVX1Q='
WHERE
key_id = 'e975d0b63f3ed3f77e287dd2c90878982e7418c5d8a0188deedddc07299562d8'
AND (
token = 'OzD6GXIVJ1d9idUEV3YIQasSa9fXZbO5O4rsHInVX1Q='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)