UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vjrM/Th9iX/iKX+mFaW6EekOnMn1InPJ5UMNzHQzFF4=' 
WHERE 
  key_id = 'cc2cc65f1fcfa9a160f6aba010a9004e84354a851401d4f75d035eda64e0a72b' 
  AND (
    token = 'vjrM/Th9iX/iKX+mFaW6EekOnMn1InPJ5UMNzHQzFF4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034