UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'uAnnJErjiRATysnZrZ+7Pgn5bbyuVMa8PSSeFoAISlY='
WHERE
key_id = 'ed356af0346f1557d445376c396fd8053d521216d7d54e74f75e84e273ed20c8'
AND (
token = 'uAnnJErjiRATysnZrZ+7Pgn5bbyuVMa8PSSeFoAISlY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)