UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'fc/lvK/uezYvEKzMkWfHaR0lx7PpybeL9V5mye3usjk=' 
WHERE 
  key_id = '501bd23e2fd2f361ad31807bdfe6d09a56775c414f63642ad861ae1bc850fa0e' 
  AND (
    token = 'fc/lvK/uezYvEKzMkWfHaR0lx7PpybeL9V5mye3usjk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026