UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'MfVLTjsI0h/+UlNDNM1PHJt4e0RMBOpOw4UgPxaNNDQ=' 
WHERE 
  key_id = 'db0582f4494642a76613d82492ca275ed603edf350a50dfd0b59f3ca81a89569' 
  AND (
    token = 'MfVLTjsI0h/+UlNDNM1PHJt4e0RMBOpOw4UgPxaNNDQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030