UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'aPLni4/2JATsvHROoO3Usxo0wPe7C6NACif8Y9Po5tU='
WHERE
key_id = '649163266cdbc17459b5d5691aca91a69b0fefcaaf1d4381c453422c57c4cad5'
AND (
token = 'aPLni4/2JATsvHROoO3Usxo0wPe7C6NACif8Y9Po5tU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)