UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0OHs2H3XPADlQQ2Hotz6uH/S5MJbJf4o25aPN0t/TAE=' 
WHERE 
  key_id = '7ade908227e320ba95032d4de5781b8f558e081acff2c58ceb6c6cd629414b75' 
  AND (
    token = '0OHs2H3XPADlQQ2Hotz6uH/S5MJbJf4o25aPN0t/TAE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025