UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0ktIdx+HBlhmhR4rTwB7KJBOXy3OmF53nCxgcH6d93U=' 
WHERE 
  key_id = '241bfeea04d26eab7966939a1135942893a18a74f5d039ab3a4025361a322c25' 
  AND (
    token = '0ktIdx+HBlhmhR4rTwB7KJBOXy3OmF53nCxgcH6d93U=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030