UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'pjKltRUnTnXnmidBownyPbOdMF879ix6DP6/hvmXKcw=' 
WHERE 
  key_id = '0e86e7888db7611da6a84d121128ef1585b4242413f55de71718f087125803d8' 
  AND (
    token = 'pjKltRUnTnXnmidBownyPbOdMF879ix6DP6/hvmXKcw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021