UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'oladg5oMoHVAzA4s9A3SzLjPhX5TFUMklW+MnL2uZhw='
WHERE
key_id = '27e19b84d793a7c25988f36bbe0e3ce6fac15297e43d0bbc16271dabd04acb9c'
AND (
token = 'oladg5oMoHVAzA4s9A3SzLjPhX5TFUMklW+MnL2uZhw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)