UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/wpOsoqp9f4IWBImUC5A1xXAH2ItYObL2ZKGYUDlElU='
WHERE
key_id = '87a864d4202c3935c28bfa79a0ce244551def3b9eaaf48b5fe1c7e3939a10a00'
AND (
token = '/wpOsoqp9f4IWBImUC5A1xXAH2ItYObL2ZKGYUDlElU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)