UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Pa/5a4olGbOXs3tTrSI3HWKlzVKYGfCJ6XBHqp28e9g='
WHERE
key_id = 'aff914ffb753a5469393d73bca811c8869ce44ccf32b523d5cc842d2fd37975b'
AND (
token = 'Pa/5a4olGbOXs3tTrSI3HWKlzVKYGfCJ6XBHqp28e9g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)