UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'KHLLWyolNcGSf5XU8tNgc2jsm/l7mHhq1fDi4XNcsgU=' 
WHERE 
  key_id = '7c3716f13453bae1fcd5a3415bf8a6b06770d0310078687057559dbdbb3ca5d8' 
  AND (
    token = 'KHLLWyolNcGSf5XU8tNgc2jsm/l7mHhq1fDi4XNcsgU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037