UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'sk5X057ZY2HJ8dRK84fgBUoE3j5ZWUIO0RhHkebMOVg=' 
WHERE 
  key_id = '4bbef2a65c363e4d15fb099a4baf59ee0672c7b81f3f2c953172dfb3b1239c38' 
  AND (
    token = 'sk5X057ZY2HJ8dRK84fgBUoE3j5ZWUIO0RhHkebMOVg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032