UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'WH0mE2UY95Mu4WNgex0zvbhO25tSNL5RhYomS4/rKKY=' 
WHERE 
  key_id = '229a3c7ada30c92fff6960475c8286d0be2c2983bfe8d4e26d0cade9a0c3536c' 
  AND (
    token = 'WH0mE2UY95Mu4WNgex0zvbhO25tSNL5RhYomS4/rKKY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021